package com.srd.phone.activity;

import android.os.Bundle;
import android.widget.RadioGroup;

import com.shengrongdai.srd.R;
import com.srd.phone.fragment.RegisterEnterpriseFragment;
import com.srd.phone.fragment.RegisterPeopleFragment;

/**
 * 注册界面
 */
public class RegisterActivity extends BaseActivity {

    private RadioGroup rg_register;
    private RegisterPeopleFragment peopleFragment;
    private RegisterEnterpriseFragment enterpriseFragment;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        tv_common_title.setText("注册");
        peopleFragment = new RegisterPeopleFragment();
        enterpriseFragment = new RegisterEnterpriseFragment();
        rg_register = (RadioGroup) findViewById(R.id.rg_register);
        rg_register.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, int checkedId) {
                if (checkedId == R.id.rb_register_people) {
                    replaceFragment(R.id.ll_register, peopleFragment);
                } else if (checkedId == R.id.rb_register_enterprise) {
                    replaceFragment(R.id.ll_register, enterpriseFragment);
                }
            }
        });
        rg_register.check(R.id.rb_register_people);
    }

}
